<?php
	$pages = ceil($num_rows / $num_reg);
	$pages++;
	
	for($pg=1; $pg<$pages; $pg++){	
		if($_GET['pg'] == ($pg-1)){
			echo "<li><a href='javascript:void(0);' class='active'>".$pg."</a></li>";
		}else{
			$url = explode("&pg=", $_SERVER['REQUEST_URI']);			
			echo "<li><a href='".$url[0]."&pg=".($pg-1)."'>".$pg."</a></li>";
		}
	}	
?> 